package com.nondo.rdp.finance.service.impl.setting.home;

import com.nondo.rdp.finance.domain.setting.home.SettingModuleSecurityOpen;
import com.nondo.rdp.finance.repository.setting.home.SettingModuleSecurityOpenRepository;
import com.nondo.rdp.finance.service.setting.home.SettingModuleSecurityOpenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service
public class SettingModuleSecurityOpenServiceImpl implements SettingModuleSecurityOpenService {
    @Autowired
    SettingModuleSecurityOpenRepository settingModuleSecurityOpenRepository;

    @Override
    public SettingModuleSecurityOpen findOne(Long id) {
        return this.settingModuleSecurityOpenRepository.findOne(id);
    }

    @Override
    public SettingModuleSecurityOpen save(SettingModuleSecurityOpen settingModuleSecurityOpen) {
        return this.settingModuleSecurityOpenRepository.save(settingModuleSecurityOpen);
    }

    @Override
    public void update(SettingModuleSecurityOpen settingModuleSecurityOpen) {
        this.settingModuleSecurityOpenRepository.save(settingModuleSecurityOpen);
    }

    @Override
    public void delete(Long id) {
        this.settingModuleSecurityOpenRepository.deleteById(id);
    }

    @Override
    public List<SettingModuleSecurityOpen> findAll(Sort sort) {
        return this.settingModuleSecurityOpenRepository.findAllByDelFlag("0", sort);
    }
}